package com.zyfdroid.mindnote2;

import android.app.Activity;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.Handler;
import android.util.TypedValue;


import com.zyfdroid.mindnote2.utils.AppSettings;


public class BaseActivity extends Activity {

    protected Handler hWnd = new Handler();

    public int dp2pix(float dp) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, Resources.getSystem().getDisplayMetrics());
    }

    @Override
    protected void onCreate( Bundle savedInstanceState) {
        boolean transparent = AppSettings.transparentWindow;
        if(transparent){
            setTheme(R.style.Theme_思维笔记_Transparent);
        }

        super.onCreate(savedInstanceState);
        if(getActionBar()!=null){
            getActionBar().setElevation(dp2pix(6));
        }
    }

}
